import request from '@/utils/request'
//获取推荐线路

// 查询线路
export const getListLinesService = (params) =>
  request.get('/api/route/search/list/page', { params })
export const DelRoutes = (ids) => {
  request.post('/api/route/delete', { ids })
}
export const AddRoutes = (data) =>
  request.post('/api/route/add', data, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })

export const UpdateService = (data) =>
  request.post('/api/route/update', data, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })

export const AuditService = (params) =>
  request.post('/api/route/audit', params, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })
// No changes needed if the above code is correct and request is properly defined.

export const CommendService = (params) =>
  request.get('/api/route/recommend', params, {
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  })
// 图片更新接口
export const UpdateImagesService = (data) =>
  request.post('/api/route/update/image', data, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
//添加图片
export const addImageService = (data) =>
  request.post('/api/route/add/image', data, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
//删除图片
export const deleteImageService = (data) =>
  request.post('/api/route/delete/image', data, {
    headers: {
      'Content-Type': 'application/json'
    }
  })
